package ua.org.cityid.server.handlers;

import com.google.inject.Inject;

import net.customware.gwt.dispatch.server.ActionHandler;
import net.customware.gwt.dispatch.server.ExecutionContext;
import net.customware.gwt.dispatch.shared.ActionException;
import ua.org.cityid.client.actions.GetCitiesCount;
import ua.org.cityid.client.actions.GetCitiesCountResult;
import ua.org.cityid.server.DA.CityDA;

public class GetCitiesCountHandler implements ActionHandler<GetCitiesCount, GetCitiesCountResult>{
	private CityDA dataAccess = null;
	
	@Inject
	public GetCitiesCountHandler(CityDA cityDA){
		dataAccess = cityDA;
	}
	
	@Override
	public GetCitiesCountResult execute(GetCitiesCount request,
			ExecutionContext arg1) throws ActionException {
		return dataAccess.getCitiesCount(request);
	}

	@Override
	public Class<GetCitiesCount> getActionType() {
		return GetCitiesCount.class;
	}

	@Override
	public void rollback(GetCitiesCount arg0, GetCitiesCountResult arg1,
			ExecutionContext arg2) throws ActionException {
		// TODO Auto-generated method stub
		
	}

}
